package com.bristua.mall.user.controller;

import com.bristua.mall.common.bean.Result;
import com.bristua.mall.common.utils.HandleResultUtil;
import com.bristua.mall.user.biz.CancelGoodsCollectionBiz;
import com.bristua.mall.user.enums.UserCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(value="取消收藏",tags={"取消收藏"})
public class CancelGoodsCollectionController {

    @Autowired
    private CancelGoodsCollectionBiz cancelGoodsCollectionBiz;

    @ApiOperation(value="取消收藏")
    @PostMapping(value = "/api/cancel/goods/collection/{goodsId}")
    public Result cancelGoodsCollection(@PathVariable(value = "goodsId") String goodsId){
        cancelGoodsCollectionBiz.cancelGoodsCollection(goodsId);
        return HandleResultUtil.commonResult(UserCode.CANCEL_GOODS_COLLECTION.getCode(),UserCode.CANCEL_GOODS_COLLECTION.getMsg());
    }
}
